#ifndef RENDERGROUP_H
#define RENDERGROUP_H
#include "StompedReality/Core.h"
#include <vector>

namespace StompedReality
{

class IGame;

namespace Graphics
{

class RenderFunction;

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Render function group.
 *
 *    Stores render functions.
 *    Sends render functions to renderer.
 */
class DLL_EXPORT RenderGroup
{
 protected:

  typedef std::vector<StompedReality::Graphics::RenderFunction*> RenderFunctionList;

  unsigned int m_RenderKey;
  RenderFunctionList m_RenderFunctions;

 public:

  //! \brief	Constructor.
  RenderGroup ( );

  //! \brief	Destructor.
  ~RenderGroup ( );

//! \brief	Render order setter.
  void SetRenderOrder ( unsigned int renderKey );

  //! \brief	Render order getter.
  unsigned int GetRenderOrder ( );

  //! \brief	Sends render functions to the renderer.
  //! \param	game	The game.
  void Draw ( StompedReality::IGame* game );

  //! \brief	Sort stored render functions.
  void SortFunctions( );

  //! \brief	Add render functions.
  //! \param	function	The render function.
  void AddRenderFunction ( StompedReality::Graphics::RenderFunction* function );
};

}

}

#endif // RENDERGROUP_H
